package cn.edu.sdu.order.backend.service.impl;

import cn.edu.sdu.order.backend.dao.UserMapper;
import cn.edu.sdu.order.backend.model.Token;
import cn.edu.sdu.order.backend.service.SystemService;
import cn.edu.sdu.order.backend.service.TokenService;
import cn.edu.sdu.order.backend.vo.SystemVO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SystemServiceImpl implements SystemService {

    @Autowired
    private TokenService tokenService;

    @Override
    public SystemVO login(String workCode, String password) {
        Token token = tokenService.login(workCode, password);
        SystemVO systemVO = new SystemVO();
        BeanUtils.copyProperties(token, systemVO);
        return systemVO;
    }

}
